﻿using System.Text;

namespace UPKAndUDKUnpackTools.Tools;

public class TextBoxWriter(TextBox textBox) : TextWriter
{
    public override void Write(char value)
    {
        textBox.Invoke((MethodInvoker)delegate
        {
            textBox.AppendText(value.ToString());
        });
    }

    public override void Write(string value)
    {
        textBox.Invoke((MethodInvoker)delegate
        {
            textBox.AppendText(value);
        });
    }

    public override Encoding Encoding => Encoding.UTF8;
}